import React, { Component } from 'react';
import {
    Text, Image, View, ToastAndroid, PixelRatio, ScrollView, TouchableOpacity
} from 'react-native';
import TestFunctionUtils from '../util/TestFunctionUtils';

import Head from './layout/Head';
import styles from '../../assets/css/style.js';
import GlobalConfig from '../util/Global';
const rem = GlobalConfig.WIDTH/7.5;
const her = (GlobalConfig.HEIGHT-6.84*rem);


/**
 * 测试功能
 */
export default class TestFunctionView extends Component {
    constructor(props) {
        super(props);
        this.state = {

        };
    }
    render(){
        const {navigate} = this.props.navigation;
        const lists=[["首 页","icon_in", GlobalConfig.LOGIN_VIEW],
                     ["状态查看","icon_ck", GlobalConfig.STATUS_CHECK_VIEW],
                     ["设 置","icon_sz", GlobalConfig.SETTING_VIEW]];
        return (
            <View style={[styles.flex,styles.bgcolor]}>
                <Head title="测试功能" ref='head' list={lists} navigate={navigate}> </Head>
                <View style={styles.flex}>
                    <ScrollView style={styles.ztScroll}>
                        <View style={styles.ccwrap}>
                            <TouchableOpacity activeOpacity={1}  onPress={() => ToastAndroid.show('一键诊断功能', ToastAndroid.SHORT)}>
                                <View style={styles.iconWrap}>
                                    <Image
                                        style={styles.ccIcon_gif}
                                        resizeMode="contain"
                                        source={require('../../assets/img/icon_bgImg.png')}
                                    />
                                    <Text style={styles.icon_font}>一键诊断</Text>
                            </View>
                            </TouchableOpacity>
                            <View style={styles.test_tex}>
                                <View style={[styles.test_list,styles.opacity01]}>
                                    <Text style={styles.test_font}>路由器安全性</Text>
                                    <Image
                                        style={styles.icon_test}
                                        resizeMode="contain"
                                        source={require('../../assets/img/icon_test.png')}
                                    />
                                </View>
                                <View style={[styles.test_list,styles.opacity02]}>
                                    <Text style={styles.test_font}>WIFI密码安全</Text>
                                    <Image
                                        style={styles.icon_test}
                                        resizeMode="contain"
                                        source={require('../../assets/img/icon_test.png')}
                                    />
                                </View>
                                <View style={styles.test_list}>
                                    <Text style={styles.test_font}>WIFI接入速度</Text>
                                    <Image
                                        style={styles.icon_test}
                                        resizeMode="contain"
                                        source={require('../../assets/img/icon_test.png')}
                                    />
                                </View>
                                <View style={styles.test_list}>
                                    <Text style={styles.test_font}>下行下载速率</Text>
                                    <Image
                                        style={styles.icon_test}
                                        resizeMode="contain"
                                        source={require('../../assets/img/icon_test.png')}
                                    />
                                </View>
                            </View>
                        </View>
                        <View style={[styles.center,{height:her}]}>
                            <TouchableOpacity activeOpacity={1} onPress={() => TestFunctionUtils.coverTest(navigate)}>
                                <View style={styles.fgwrap}>
                                    <Text style={styles.fgFont}>覆盖测试</Text>
                                </View>
                            </TouchableOpacity>
                        </View>
                    </ScrollView>
                </View>
            </View>
        )

       
    }
}